import axios from 'axios';
import { setupRequestInterceptors, setupResponseInterceptors } from './interceptors';

// 创建axios实例
const service = axios.create({
    baseURL: import.meta.env.MODE === 'production' ? import.meta.env.VITE_BASE_URL : '/api',
    timeout: 10000,
    headers: {
        'Content-Type': 'application/json;charset=utf-8'
    }
});

// 设置拦截器
setupRequestInterceptors(service);
setupResponseInterceptors(service);

export default service;
